# **********************************************************************
#
# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# **********************************************************************

# Ice version 3.3.1
# Generated from file `Qwerk.ice'

import Ice, IcePy, __builtin__

if not Ice.__dict__.has_key("_struct_marker"):
    Ice._struct_marker = object()
import AnalogIn_ice
import Audio_ice
import DigitalIn_ice
import DigitalOut_ice
import LED_ice
import Motor_ice
import Servo_ice
import TeRKCommon_ice

# Included module Ice
_M_Ice = Ice.openModule('Ice')

# Included module Glacier2
_M_Glacier2 = Ice.openModule('Glacier2')

# Included module peer
_M_peer = Ice.openModule('peer')

# Included module TeRK
_M_TeRK = Ice.openModule('TeRK')

# Start of module TeRK
__name__ = 'TeRK'

if not _M_TeRK.__dict__.has_key('BatteryState'):
    _M_TeRK.BatteryState = Ice.createTempClass()
    class BatteryState(object):
        def __init__(self, batteryVoltage=0):
            self.batteryVoltage = batteryVoltage

        def __hash__(self):
            _h = 0
            _h = 5 * _h + __builtin__.hash(self.batteryVoltage)
            return _h % 0x7fffffff

        def __cmp__(self, other):
            if other == None:
                return 1
            if self.batteryVoltage < other.batteryVoltage:
                return -1
            elif self.batteryVoltage > other.batteryVoltage:
                return 1
            return 0

        def __str__(self):
            return IcePy.stringify(self, _M_TeRK._t_BatteryState)

        __repr__ = __str__

    _M_TeRK._t_BatteryState = IcePy.defineStruct('::TeRK::BatteryState', BatteryState, (), (('batteryVoltage', (), IcePy._t_int),))

    _M_TeRK.BatteryState = BatteryState
    del BatteryState

if not _M_TeRK.__dict__.has_key('ButtonState'):
    _M_TeRK.ButtonState = Ice.createTempClass()
    class ButtonState(object):
        def __init__(self, buttonStates=None):
            self.buttonStates = buttonStates

        def __hash__(self):
            _h = 0
            if self.buttonStates:
                for _i0 in self.buttonStates:
                    _h = 5 * _h + __builtin__.hash(_i0)
            return _h % 0x7fffffff

        def __cmp__(self, other):
            if other == None:
                return 1
            if self.buttonStates < other.buttonStates:
                return -1
            elif self.buttonStates > other.buttonStates:
                return 1
            return 0

        def __str__(self):
            return IcePy.stringify(self, _M_TeRK._t_ButtonState)

        __repr__ = __str__

    _M_TeRK._t_ButtonState = IcePy.defineStruct('::TeRK::ButtonState', ButtonState, (), (('buttonStates', (), _M_TeRK._t_BooleanArray),))

    _M_TeRK.ButtonState = ButtonState
    del ButtonState

if not _M_TeRK.__dict__.has_key('QwerkState'):
    _M_TeRK.QwerkState = Ice.createTempClass()
    class QwerkState(object):
        def __init__(self, analogIn=Ice._struct_marker, battery=Ice._struct_marker, button=Ice._struct_marker, digitalIn=Ice._struct_marker, motor=Ice._struct_marker, servo=Ice._struct_marker):
            if analogIn is Ice._struct_marker:
                self.analogIn = _M_TeRK.AnalogInState()
            else:
                self.analogIn = analogIn
            if battery is Ice._struct_marker:
                self.battery = _M_TeRK.BatteryState()
            else:
                self.battery = battery
            if button is Ice._struct_marker:
                self.button = _M_TeRK.ButtonState()
            else:
                self.button = button
            if digitalIn is Ice._struct_marker:
                self.digitalIn = _M_TeRK.DigitalInState()
            else:
                self.digitalIn = digitalIn
            if motor is Ice._struct_marker:
                self.motor = _M_TeRK.MotorState()
            else:
                self.motor = motor
            if servo is Ice._struct_marker:
                self.servo = _M_TeRK.ServoState()
            else:
                self.servo = servo

        def __hash__(self):
            _h = 0
            _h = 5 * _h + __builtin__.hash(self.analogIn)
            _h = 5 * _h + __builtin__.hash(self.battery)
            _h = 5 * _h + __builtin__.hash(self.button)
            _h = 5 * _h + __builtin__.hash(self.digitalIn)
            _h = 5 * _h + __builtin__.hash(self.motor)
            _h = 5 * _h + __builtin__.hash(self.servo)
            return _h % 0x7fffffff

        def __cmp__(self, other):
            if other == None:
                return 1
            if self.analogIn < other.analogIn:
                return -1
            elif self.analogIn > other.analogIn:
                return 1
            if self.battery < other.battery:
                return -1
            elif self.battery > other.battery:
                return 1
            if self.button < other.button:
                return -1
            elif self.button > other.button:
                return 1
            if self.digitalIn < other.digitalIn:
                return -1
            elif self.digitalIn > other.digitalIn:
                return 1
            if self.motor < other.motor:
                return -1
            elif self.motor > other.motor:
                return 1
            if self.servo < other.servo:
                return -1
            elif self.servo > other.servo:
                return 1
            return 0

        def __str__(self):
            return IcePy.stringify(self, _M_TeRK._t_QwerkState)

        __repr__ = __str__

    _M_TeRK._t_QwerkState = IcePy.defineStruct('::TeRK::QwerkState', QwerkState, (), (
        ('analogIn', (), _M_TeRK._t_AnalogInState),
        ('battery', (), _M_TeRK._t_BatteryState),
        ('button', (), _M_TeRK._t_ButtonState),
        ('digitalIn', (), _M_TeRK._t_DigitalInState),
        ('motor', (), _M_TeRK._t_MotorState),
        ('servo', (), _M_TeRK._t_ServoState)
    ))

    _M_TeRK.QwerkState = QwerkState
    del QwerkState

if not _M_TeRK.__dict__.has_key('QwerkCommand'):
    _M_TeRK.QwerkCommand = Ice.createTempClass()
    class QwerkCommand(object):
        def __init__(self, audioCmd=Ice._struct_marker, digitalOutCmd=Ice._struct_marker, ledCmd=Ice._struct_marker, motorCmd=Ice._struct_marker, servoCmd=Ice._struct_marker):
            if audioCmd is Ice._struct_marker:
                self.audioCmd = _M_TeRK.AudioCommand()
            else:
                self.audioCmd = audioCmd
            if digitalOutCmd is Ice._struct_marker:
                self.digitalOutCmd = _M_TeRK.DigitalOutCommand()
            else:
                self.digitalOutCmd = digitalOutCmd
            if ledCmd is Ice._struct_marker:
                self.ledCmd = _M_TeRK.LEDCommand()
            else:
                self.ledCmd = ledCmd
            if motorCmd is Ice._struct_marker:
                self.motorCmd = _M_TeRK.MotorCommand()
            else:
                self.motorCmd = motorCmd
            if servoCmd is Ice._struct_marker:
                self.servoCmd = _M_TeRK.ServoCommand()
            else:
                self.servoCmd = servoCmd

        def __hash__(self):
            _h = 0
            _h = 5 * _h + __builtin__.hash(self.audioCmd)
            _h = 5 * _h + __builtin__.hash(self.digitalOutCmd)
            _h = 5 * _h + __builtin__.hash(self.ledCmd)
            _h = 5 * _h + __builtin__.hash(self.motorCmd)
            _h = 5 * _h + __builtin__.hash(self.servoCmd)
            return _h % 0x7fffffff

        def __cmp__(self, other):
            if other == None:
                return 1
            if self.audioCmd < other.audioCmd:
                return -1
            elif self.audioCmd > other.audioCmd:
                return 1
            if self.digitalOutCmd < other.digitalOutCmd:
                return -1
            elif self.digitalOutCmd > other.digitalOutCmd:
                return 1
            if self.ledCmd < other.ledCmd:
                return -1
            elif self.ledCmd > other.ledCmd:
                return 1
            if self.motorCmd < other.motorCmd:
                return -1
            elif self.motorCmd > other.motorCmd:
                return 1
            if self.servoCmd < other.servoCmd:
                return -1
            elif self.servoCmd > other.servoCmd:
                return 1
            return 0

        def __str__(self):
            return IcePy.stringify(self, _M_TeRK._t_QwerkCommand)

        __repr__ = __str__

    _M_TeRK._t_QwerkCommand = IcePy.defineStruct('::TeRK::QwerkCommand', QwerkCommand, (), (
        ('audioCmd', (), _M_TeRK._t_AudioCommand),
        ('digitalOutCmd', (), _M_TeRK._t_DigitalOutCommand),
        ('ledCmd', (), _M_TeRK._t_LEDCommand),
        ('motorCmd', (), _M_TeRK._t_MotorCommand),
        ('servoCmd', (), _M_TeRK._t_ServoCommand)
    ))

    _M_TeRK.QwerkCommand = QwerkCommand
    del QwerkCommand

if not _M_TeRK.__dict__.has_key('Qwerk'):
    _M_TeRK.Qwerk = Ice.createTempClass()
    class Qwerk(_M_TeRK.TerkUser):
        def __init__(self):
            if __builtin__.type(self) == _M_TeRK.Qwerk:
                raise RuntimeError('TeRK.Qwerk is an abstract class')

        def ice_ids(self, current=None):
            return ('::Ice::Object', '::TeRK::PropertyManager', '::TeRK::Qwerk', '::TeRK::TerkUser', '::peer::ConnectionEventHandler', '::peer::PeerConnectionEventHandler', '::peer::UserConnectionEventHandler')

        def ice_id(self, current=None):
            return '::TeRK::Qwerk'

        def ice_staticId():
            return '::TeRK::Qwerk'
        ice_staticId = staticmethod(ice_staticId)

        #
        # Operation signatures.
        #
        # def getState(self, current=None):
        # def execute(self, command, current=None):
        # def emergencyStop(self, current=None):
        # def getCommandControllerTypeToProxyIdentityMap(self, current=None):

        def __str__(self):
            return IcePy.stringify(self, _M_TeRK._t_Qwerk)

        __repr__ = __str__

    _M_TeRK.QwerkPrx = Ice.createTempClass()
    class QwerkPrx(_M_TeRK.TerkUserPrx):

        def getState(self, _ctx=None):
            return _M_TeRK.Qwerk._op_getState.invoke(self, ((), _ctx))

        def getState_async(self, _cb, _ctx=None):
            return _M_TeRK.Qwerk._op_getState.invokeAsync(self, (_cb, (), _ctx))

        def execute(self, command, _ctx=None):
            return _M_TeRK.Qwerk._op_execute.invoke(self, ((command, ), _ctx))

        def execute_async(self, _cb, command, _ctx=None):
            return _M_TeRK.Qwerk._op_execute.invokeAsync(self, (_cb, (command, ), _ctx))

        def emergencyStop(self, _ctx=None):
            return _M_TeRK.Qwerk._op_emergencyStop.invoke(self, ((), _ctx))

        def emergencyStop_async(self, _cb, _ctx=None):
            return _M_TeRK.Qwerk._op_emergencyStop.invokeAsync(self, (_cb, (), _ctx))

        def getCommandControllerTypeToProxyIdentityMap(self, _ctx=None):
            return _M_TeRK.Qwerk._op_getCommandControllerTypeToProxyIdentityMap.invoke(self, ((), _ctx))

        def getCommandControllerTypeToProxyIdentityMap_async(self, _cb, _ctx=None):
            return _M_TeRK.Qwerk._op_getCommandControllerTypeToProxyIdentityMap.invokeAsync(self, (_cb, (), _ctx))

        def checkedCast(proxy, facetOrCtx=None, _ctx=None):
            return _M_TeRK.QwerkPrx.ice_checkedCast(proxy, '::TeRK::Qwerk', facetOrCtx, _ctx)
        checkedCast = staticmethod(checkedCast)

        def uncheckedCast(proxy, facet=None):
            return _M_TeRK.QwerkPrx.ice_uncheckedCast(proxy, facet)
        uncheckedCast = staticmethod(uncheckedCast)

    _M_TeRK._t_QwerkPrx = IcePy.defineProxy('::TeRK::Qwerk', QwerkPrx)

    _M_TeRK._t_Qwerk = IcePy.defineClass('::TeRK::Qwerk', Qwerk, (), True, None, (_M_TeRK._t_TerkUser,), ())
    Qwerk.ice_type = _M_TeRK._t_Qwerk

    Qwerk._op_getState = IcePy.Operation('getState', Ice.OperationMode.Nonmutating, Ice.OperationMode.Nonmutating, False, (), (), (), _M_TeRK._t_QwerkState, ())
    Qwerk._op_execute = IcePy.Operation('execute', Ice.OperationMode.Normal, Ice.OperationMode.Normal, False, (), (((), _M_TeRK._t_QwerkCommand),), (), _M_TeRK._t_QwerkState, (_M_TeRK._t_CommandException,))
    Qwerk._op_emergencyStop = IcePy.Operation('emergencyStop', Ice.OperationMode.Idempotent, Ice.OperationMode.Idempotent, False, (), (), (), _M_TeRK._t_QwerkState, ())
    Qwerk._op_getCommandControllerTypeToProxyIdentityMap = IcePy.Operation('getCommandControllerTypeToProxyIdentityMap', Ice.OperationMode.Nonmutating, Ice.OperationMode.Nonmutating, False, (), (), (), _M_TeRK._t_ProxyTypeIdToIdentityMap, ())

    _M_TeRK.Qwerk = Qwerk
    del Qwerk

    _M_TeRK.QwerkPrx = QwerkPrx
    del QwerkPrx

# End of module TeRK
